﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using RayDen.Library.Components.Surface;
using RayDen.Library.Core.Components;
using RayDen.Library.Entity.Scene;

namespace RayEngine.Spectral.Entities.Brdfs
{
    public class BrdfFactory : Singleton<BrdfFactory>
    {
        public BrdfBase CreateBrdf(MaterialInfo mi)
        {
            var matClass =BrdfClassNameMapper.GetMaterialClass(mi);
            switch (matClass)
            {
                    case BrdfClass.GlossyMetal:
                        return new MetalBrdf();
                    case BrdfClass.Alloy:
                        return new AlloyBrdf(mi.Exponent, 0.5f, false);
                    case BrdfClass.Glass:
                        return new SimpleGlass(1.0f, 1.55f);
            }
            return new LambertBrdf();
        }
    }
}
